nums = [1, 2, 3]

res = []
import sys

# 先求阶乘
factorial = 1
for i in range(1, len(nums) + 1):
    factorial = factorial * i


def process(k):
    if k > factorial:
        print(res)
        sys.exit()
    for i in range(k, len(nums) - 1):
        chosen_num = str(nums[i])
        del nums[i]
        new_num = list(chosen_num + str(nums))
        res.append(res)
    return process(k + 1)


process(0)
